<template>
  <div>
    <sub-component :obj="obj" @toParent="getChildren"></sub-component>
      <div>{{msg}}</div>
  </div>
</template>

<script>
import subComponent from "@/components/subComponent"
export default {
  name:'test',
    components:{
        subComponent
    },
    data(){
      return {
          obj:{
              username:"zhangsan",
              age:12,
              tel:17859903495
          },
          msg:""
      }
    },
    methods:{
        getChildren(e){
            console.log(e);
            this.msg=e.id
        }
    }
}
</script>
